<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<base href="http://localhost:8080/jxc/" />
<title>进销存首页</title>
</head>
<body>
<h1>Hello</h1>
<p id="userinfo">userinfo</p>
<button id="button1">showuserinfo</button>
<button id="button2">clear</button>
<script src="static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(function () {
	var userinfo = localStorage.getItem("userinfo");
	var $userinfo = JSON.parse(userinfo);
	$("#button1").click(function(){
		$("#userinfo").html($userinfo.userloginname);//JSON.parse()
	});
	$("#button2").click(function(){
		localStorage.clear();
	});
});
</script>
</body>
</html>